<template>
  <div class="Mtask-main">
    <div class="Mtask-main-box" v-if="false">
      <div class="main-box-div">
        <div class="box-div-text">排序方式</div>
      </div>
      <div class="main-box-div">
        <div class="box-div-text">佣金</div>
        <div class="box-div-img">
          <a><img src="static/imgs/xxxx1.png"/></a>
          <a><img src="static/imgs/xxxx2.png"/></a>
        </div>
      </div>
      <div class="main-box-div">
        <div class="box-div-text">价格</div>
        <div class="box-div-img">
          <a><img src="static/imgs/xxxx1.png"/></a>
          <a><img src="static/imgs/xxxx2.png"/></a>
        </div>
      </div>
    </div>
    <div v-if="list.length>0" class="matsk-list-box">

      <!-- list -->
      <div class="Mtask-main-list">
        <ul v-if="list.length>0">
          <li v-for="item in list">
            <router-link :to="{name:'taskDetails',params:{id:item.taskKeyId},query:$route.query}">
              <div class="main-list-box">
                <div class="main-list-left">
							<span>
								<a>ID:</a>
								<a>{{item.taskKeyId}}</a>
								<!--<a>(剩余:{{item.num}}单)</a>-->
							</span>
                  <span v-show="item.goodsMoney">
								      {{item.goodsMoney}}元
							  </span>
                </div>
                <div class="main-list-right">
							 <span>
							 	<a><img src="static/imgs/qian.png" alt="" title=""/></a>
							 	<a>{{item.reward}}</a>
							 </span>
                  <span>
							 	<a v-if="item.publishTime">{{item.publishTime|dataFormat}}</a>
							 	<a class="right-backColor">任务详情</a>
							 </span>
                </div>
              </div>
            </router-link>

          </li>
        </ul>
      </div>
      <!-- no more -->
      <div class="Mtask-list-noMore" @click="queryMore">{{more?'点击加载更多':'没有更多的了'}}</div>
    </div>
    <div class="order-auto" v-if="list.length===0">
      <div class="order-img-no" flex="main:center cross:center"><img src="static/imgs/dingdan2.png" alt="" title=""/>
      </div>
      <p>暂时还没相关订单哦~~</p>
    </div>

    <!-- fixednav -->
    <div class="fixed-nav">
      <index-footer></index-footer>
    </div>
    <!-- fixed -->
    <div class="fixed-border">
      <router-link :to="{name:'attention'}">
        <div class="fixed-border-box">
          <a>注意<br/>事项</a>
        </div>
      </router-link>

    </div>
  </div>
</template>


<script>
  import {taskService} from '#/service'
  import {Toast} from 'mint-ui';
  import IndexFooter from '@/components/base/IndexFooter'
  import listMixins from '../../mixins/listMixins'

  export default {
    name: 'taoBaoMtask',
    data() {
      return {
        screen: {
          mainType: '',
          platform: '',
          pageIndex: 0,
          pageSize: 10,
        },
        more: true,
        list: []
      }
    },
    created() {
      this.screen.platform = this.$route.query.platform
      this.screen.mainType = this.$route.query.mainType
      if (!this.screen.platform || !this.screen.mainType) {
        this.$router.push({
          name: 'mission'
        })
        return
      }
    },

    methods: {
      async query() {
        return await taskService.allTasks({
          params: this.screen
        })
      }
    },
    mixins: [listMixins],
    components: {
      IndexFooter
    }
  }
</script>


<style>
  html, body {
    background: #f5f5f5;
  }

  .Mtask-main {
    width: 100%;
    min-height: calc(100vh - 40px - 0.16rem - 0.5rem);
    padding-bottom: 0.5rem;
    background: rgb(242, 242, 242);
    padding-top: 40px;
  }

  .Mtask-main-box {
    width: 100%;
    padding: 0.1rem 0;
    height: 0.16rem;
    overflow: hidden;
    background: #f7f7f9;
    position: fixed;
    top: 40px;
    border-bottom: 0.01rem solid #e6e6e6;
  }

  .main-box-div {
    width: 33%;
    float: left;
    line-height: 0.16rem;
    position: relative;
    border-right: 0.01rem solid #e6e6e6;
    font-size: 0.12rem;
  }

  .main-box-div:last-child {
    border-right: none
  }

  .box-div-text {
    text-align: center;
    color: #777;
    font-size: 0.12rem;
  }

  .box-div-img {
    position: absolute;
    right: 0.35rem;
    top: 0.04rem;
  }

  .box-div-img a {
    display: block;
    width: 0.06rem;
    height: 0.04rem;
  }

  .box-div-img a:first-child {
    margin-bottom: 0.02rem;
  }

  .box-div-img a img {
    display: block;
    width: 100%;
  }

  .Mtask-main-list {
    width: 100%;
    height: auto;
    margin-top: 0.1rem;
    overflow: hidden;
  }

  .Mtask-main-list ul li {
    width: 100%;
    height: 0.83rem;
    float: left;
    margin-bottom: 0.1rem;
    background: white;
  }

  .Mtask-main-list ul li:last-child {
    margin-bottom: none;
  }

  .main-list-box {
    width: 92%;
    margin: 0 auto;
  }

  .main-list-left {
    width: 100%;
    float: left;
    margin-top: 0.1rem;
    height: auto;
    border-bottom: 1px dashed #626262;
  }

  .main-list-left span {
    display: block;
    float: left;
    color: #626262;
    font-size: 0.12rem;
  }

  .main-list-left span a {
    display: inline-block;
    float: left;
  }

  .main-list-left span:last-child {
    float: right;
  }

  .main-list-right {
    width: 100%;
    height: auto;
    float: left;
    margin-top: 0.15rem;
  }

  .main-list-right span {
    display: block;
    float: left;
  }

  .main-list-right span:last-child {
    float: right;
  }

  .main-list-right span a {
    display: inline-block;
    float: left;
  }

  .main-list-right span:first-child a {
    width: 0.16rem;
    height: 0.18rem;
    color: #faad45;
    font-size: 0.18rem;
    margin-right: 0.05rem;
  }

  .main-list-right span:first-child a img {
    display: block;
    width: 100%;
  }

  .main-list-right span:last-child a {
    color: #4097FF;
    font-size: 0.12rem;
    line-height: 0.26rem;
  }

  .main-list-right span:last-child .right-backColor {
    width: 0.68rem;
    height: 0.26rem;
    line-height: 0.26rem;
    background: rgb(142, 10, 190);
    text-align: center;
    color: white;
    font-size: 0.12rem;
    border-radius: 0.05rem;
    margin-left: 0.15rem;
  }

  .fixed-border {
    position: fixed;
    bottom: 0.7rem;
    left: 0.15rem;
  }

  .fixed-border-box {
    width: 0.45rem;
    height: 0.45rem;
    text-align: center;
    color: white;
    font-size: 0.12rem;
    white-space: normal;
    border-radius: 50%;
    background: rgb(142, 10, 190);
  }

  .fixed-border-box a {
    display: block;
    line-height: 0.18rem;
    padding-top: 0.05rem;
  }

  .Mtask-list-noMore {

    text-align: center;
    font-size: 0.14rem;
    padding: 0.1rem;
    color: #4097ff;
  }

  .order-auto p {
    font-size: 0.16rem;
    text-align: center;
    padding-top: 20px;
    color: #777
  }

  .matsk-list-box {
    float: left;
  }
</style>
